<mat-card class="page-title">
    <span>模型审批</span>

    <div class="btn-toolbar float-right" role="toolbar" id="divDesktop">
        <button mat-icon-button (click)="refresh()" matTooltip="刷新">
            <mat-icon color="primary">refresh</mat-icon>
        </button>
    </div>
</mat-card>

<mat-card>
    <mat-button-toggle-group #group="matButtonToggleGroup" [(ngModel)]="reviewTab" (change)="refresh()" style="height: 36px">
        <mat-button-toggle value="等待审批" align="center">
            等待审批
        </mat-button-toggle>
        <mat-button-toggle value="已审批" align="center">
            已审批
        </mat-button-toggle>
    </mat-button-toggle-group>
    <br>
    <div *ngIf="publishRequests">
        <mat-card *ngFor="let publishRequest of publishRequests; trackBy: trackIdentity" style="font-size: 14px; margin: 10px 0">
            <a (click)="treatRequest(publishRequest)">
                <div class="row">
                    <div class="col-md-3">
                        <span style="font-size: 20px; margin-top: 20px">
                            {{publishRequest.solutionName}}
                        </span>
                    </div>
                    <div class="col-md-3">
                        <span *ngIf="publishRequest.requestType === '申请上架'" style="color: blue">{{publishRequest.requestType}}</span>
                        <span *ngIf="publishRequest.requestType === '申请下架'" style="color: #f47741">{{publishRequest.requestType}}</span>
                        <br>
                        <span>{{publishRequest.requestUserLogin}}</span>
                        <span>&nbsp;&nbsp;</span>
                        <span>{{publishRequest.requestDate | date:'yy-MM-dd HH:mm'}}</span>
                        <br>
                        <span>{{publishRequest.requestReason}}</span>
                    </div>
                    <div class="col-md-6">
                        <span *ngIf="publishRequest.reviewResult === '批准'" style="color: green">批准</span>
                        <span *ngIf="publishRequest.reviewResult === '拒绝'" style="color: red">拒绝</span>
                        <br>
                        <span>{{publishRequest.reviewUserLogin}}</span>
                        <span>&nbsp;&nbsp;</span>
                        <span>{{publishRequest.reviewDate | date:'yy-MM-dd HH:mm'}}</span>
                        <br>
                        <span>{{publishRequest.reviewComment}}</span>
                    </div>
                </div>
            </a>
        </mat-card>
    </div>

    <br>
    <div>
        <mat-paginator #paginator
                       [length]="totalItems"
                       [pageSize]="itemsPerPage"
                       [pageSizeOptions]="pageSizeOptions"
                       (page)="reloadPage($event)"
                       showFirstLastButtons>
        </mat-paginator>
    </div>
</mat-card>


